#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int sum = n;
	int k = n;
	if (n == 0)
	{
		printf("%d", 0);
		return 0;
	}
	while (k < 11111)
	{
		k = k * 10 + n;
		sum = sum + k;
	}
	printf("%d", sum);
	return 0;
}